home *** CD-ROM | disk | FTP | other *** search
-
- Saxman Software
- Tools Disk Series
-
-
-
- Program: TDPRT
- Version: 2.2 11/15/87
- Purpose: Print one or more files
- Syntax: TDPRT [ filespec ... ] [ ( options ]
- Or: TDPRT [ filespec ... ] [ /options ]
- Author: Jim Standley, Saxman Software
- Language: TURBO Pascal
-
-
- Overview
-
- TDPRT is an enhanced PRINT command. It will print text files
- with control over page format and printer features. Here are
- the special optional features of TDPRT:
-
- Search path like DOS searches for programs.
- Multiple filespecs, Globals, & Wildcards.
- Default heading, user heading, or none.
- Optional ruler line on each page.
- Skip over perforation on or off.
- Printer fonts & other options.
- Six or eight Lines Per Inch.
- Three user defined printer options.
- Line numbers.
- Page numbers.
- Print a range of lines.
- Print a range of pages.
- Wrap or truncate long lines.
- Form length in inches.
- Form width in characters.
- Left margin in characters.
- Change tab width.
- Form feeds are handled.
- Redirection to disk.
- Add disk output to DOS print queue.
- Customize option defaults.
- Customize printer escape sequences.
-
-
- Printer compatibility:
-
- TDPRT sends escape sequences to the printer for print mode
- and lines-per-inch options. Values for these, and three
- user-defined printer setup strings, can be modified on a
- permanent basis to "install" the program for a given printer.
-
- If you configure TDPRT for another printer, send me the setup
- strings you use so I can add them to future releases of this
- document. Other printers could be added in options similar
- to the "FX" and "NECP3" options.
-
-
- Spooler Compatibility
-
- With Release 2.2 TDPRT uses BIOS interrupt 17(hex) to send
- output to the printer. It is my understanding that most
- spooler programs should intercept this interrupt and
- correctly send the output to the spooler buffer. I would
- like to know if you find spoolers that have difficulty or
- will not work with TDPRT.
-
-
- Running TDPRT:
-
- All options for TDPRT are given on the command line. The
- only interactive part of the program is printer setup string
- configuration. TDPRT recognizes two slightly different forms
- of command line syntax:
-
- TDPRT [ filespec ... ] [ ( option ... ]
- TDPRT [ filespec ... ] [ /option ... ]
-
- Examples:
-
- TDPRT MY.PAS ( compressed margin 10 width 96 numbers
- TDPRT MY.PAS /compressed /margin 10 /width 96 /numbers
-
- You can pause the program at any time by pressing any key.
- It will give you the option to abort printing or continue.
-
-
- Filespec:
-
- At least one file specification is required. You can give up
- to ten. For each one:
-
- If it contains a drive letter or directory name (a colon
- or a backslash) only the specified drive or directory will
- be searched for the file.
-
- If it contains global or wildcard characters (asterisk or
- question mark) only the current directory or specified
- directory will be searched.
-
- If the filespec does not contain any of those special
- things, TDPRT will search the current directory then each
- directory in the path.
-
- Examples:
-
- FRED.PAS - Path Searching ON
- *.PAS - Path Searching OFF current dir only
- C:\FRED.PAS - Path Searching OFF C:\ only
-
-
- Prior to version 2.2 there was a bug when the filespec
- included a drive or path and a global or wildcard. With
- version 2.2 or later, this will work:
-
- TDPRT C:\ANOTHER\SUBDIR\*.*
-
-
- Option overview:
-
- Syntax format 1 is patterned after IBM's VM/CMS. Options are
- given after an open paren. Anything before the paren is the
- filespec list and anything after is the option list. Options
- are all keywords, some with associated values following them.
- The keywords are self-descriptive and easy to remember.
-
- Format 2 is more common to DOS applications. Each option is
- given with a slash. As with format 1, all filespecs must be
- given before the first option. You don't need any slash
- options before a quoted title. The following rules about
- minimum truncations are the same with either format.
-
- Here are all the options in alpha order (except user-defined
- options which are last.) The shortest valid abbreviations
- are in caps. Shortest abbreviation was derived by putting
- them in the order shown below and seeing how many letters are
- needed to tell each from the one before it. When you're
- learning, you may feel more comfortable typing in the whole
- word. When you're more proficient you can save some time by
- abbreviating. As a matter of style, I always code the full
- keyword in BATCH files.
-
- Compressed - Compressed print mode.
- DOS - Add disk output to DOS queue.
- DOUble - Double strike print mode.
- Elite - Elite print mode.
- EMphasized - Emphasized print mode.
- Formlength nn - Form length in inches, decimal fractions.
- FROMLine - Starting line of input to be printed.
- FROMPage - Starting page of ouptut to be printed.
- FX - Set escape sequences for Epson FX.
- Header - Enable standard page header
- Italic - Italic print mode.
- Length nn - Exactly like formlength.
- LInenumber - Line numbers down left side of page.
- LPi n - Six or eight LPI.
- Margin nn - Left margin width in characters.
- Necp3 - Set escape sequences for NEC P3.
- NODos - Do not use DOS print queue.
- NUmbers - Exactly like LInenumber.
- Pathsearch - Enable path searching
- PAgenum - Forces page numbers on user heading.
- PIca - Pica print mode. Cancels Elite.
- PRoportional - Proportional print mode.
- RUler - Scale line on each page.
- SCale - Scale line on each page.
- SOp - Enable skip over perforation.
- STandard - Reset to 'factory specs'.
- Tofile filespec - Redirect output to a file.
- TOLine - Ending line of input to be printed.
- TOPage - Ending page of output to be printed.
- TAbwidth nn - Change tab width
- TRuncate - Truncate long input lines.
- Userheader - TDPRT will prompt for a user heading.
- Width nn - Form width in characters.
- WRap - Split long input lines into two or more.
- P1 - User print setup string #1.
- P2 - User print setup string #2.
- P3 - User print setup string #3.
- 'header' - A user header can be entered on the command.
- "header" line. Enclose it in apostrophes or double
- quotes.
-
- The following options can be given with prefix 'NO' to unset
- them: COMPRESSED DOS DOUBLE ELITE EMPHASIZED HEADER ITALIC
- NUMBERS PAGENUM PATHSEARCH PICA PROPORTIONAL RULER SCALE SOP
- WRAP. Also, user defined keyword options P1, P2 and P3 can
- be deselected with NO.
-
- If opposing options are given, the last one on the command
- line is used. For example, if you give "WRAP TRUNC" then
- WRAP will be overridden and TRUNC will be used.
-
- If invalid options or combinations of options are given, the
- program will display an error message, the options given on
- the command line, and the values of all options with command
- line overrides.
-
-
- Modifying defaults
-
- I created the program with the options I prefer. You can
- reset the program to this arbitrary standard with the
- "STANDARD" keyword. To view my defaults, enter "TDPRT (
- STANDARD QUERY". If you want to make these your defaults,
- keep reading.
-
- The following keyword options are given without a filespec to
- view or modify default values. If you give a filespec with
- these options, it is ignored. These do not print anything.
-
- Query - Display current option values.
- Set - Entered with options, saves those
- options as new defaults.
- SAve - Same as Set
- CONfigure - View and modify printer control strings.
-
- The program file "TDPRT.COM" must be in the current directory
- or in a directory in the path for SAVE and CONFIGURE options.
- It uses the DOS rules for path searching for the COM file to
- modify, even if you invoke it from another drive or directory
- on the command line. Examples:
-
- TDPRT ( QUERY
- TDPRT ( LPI 8 MARGIN 10 COMPRESSED NUMBERS SAVE
- TDPRT ( CONFIGURE
-
- Bad examples:
-
- C>A:TDPRT ( CON - Won't work unless A: is in path
- \NOTNPATH\TDPRT ( CON - You can tell DOS what directory
- a program is in with 3.0+. Bad
- idea with Save/Configure.
-
-
- Some Option Details:
-
- LENGTH / FORMLENGTH nn - Give the form length in inches with
- these keywords. The program knows how many lines per inch
- it is printing and works out lines per page from there.
- For example "FO 8.5" for 8 1/2 inch paper. Maximum lines
- per page is 255 lines.
-
-
- MARGIN nn - Give a number of characters for left margin. You
- might use this to center compressed printing on the page
- or provide room for hole-punching. See WIDTH.
-
-
- WIDTH nn - Give the form width in characters. This is the
- right-most column that TDPRT will print. Subtract the
- margin and the size of line numbers (6) to get the number
- of characters that can be printed on a line. For example,
- with "WIDTH 80 MARGIN 10 NUMBERS" TDPRT will truncate or
- wrap after 64 characters of input. (80 - 10 - 6 = 64).
-
-
- HEADERS - The default header is the filename and page number.
- The option NOPAGENUM will leave the filename in the header
- but turn off the page number. The option NOHEADER turns
- off the header completely.
-
- There are two ways to give a user-defined header. The
- first is the option UHEADER. If this option is given, the
- program will prompt for a header.
-
- The second way is to enter the user header on the command
- line, enclosed in single or double quotes. The close
- quote is not needed if this is the last thing on the
- command line.
-
- Either way you give a user header, you can tell TDPRT to
- put the file name in the header by giving "/f" as the
- first two characters. You can inlude the page by giving
- "/p" as the last two characters. If you want page numbers
- but no filename, just enter "/p".
-
- Example:
-
- TDPRT *.PAS ( '/f My PASCAL Files /p'
- TDPRT *.PAS ( "/p" - page numbers only
- TDPRT *.PAS ( '/f' - file names only
-
-
- TOFILE and DOS. The TOFILE option names a file to be used for
- output. You can use the other TURBO Pascal standard
- devices here, for example "TOFILE CON:".
-
- If you are running a compatible version of DOS 3.0+, and
- you have already installed the resident portion of PRINT,
- you can use the DOS option to put the disk file into the
- DOS print queue.
-
- If you look at the output file, depending on the program
- you use, it may appear to have one extra line. This line
- contains the reset string. It is written without carriage
- return and line feed, so it will not print as an extra
- line. Some editors may add the carriage return and line
- feed if you save the file.
-
-
- FROMLINE-TOLINE or FROMPAGE-TOPAGE. These options can be
- used to print a selected portion of a file. The LINE
- options refer to line numbers in the input file. For
- example, use this to print part of a program for reference
- with a debugger that requires line numbers.
-
- The PAGE options refer to page numbers in the output.
- This might be used to reprint pages which were eaten by
- the printer.
-
- You can give FROM or TO without the other, but you cannot
- mix LINE and PAGE ranges.
-
-
- PRINT MODES. All selected setup strings except RESET are
- sent before the first file is printed. Either LPI 6 or
- LPI 8 is always selected. The RESET string is always sent
- after the last file is printed or the program is halted.
- It should cancel all the others.
-
- Prior to version 2.0 you could not deselect print mode
- options which were set as your personal defaults. As of
- version 2.0, you can singly deselect any print mode option
- with the NO prefix, for example: NOELITE. Also, the
- keyword PICA was added, which is identical to NOELITE.
-
- Setup strings can be set to "null". It is an error if a
- null string is selected on the command line.
-
-
- Printer Configuration.
-
- The option CONFIGURE enters configuration mode. Printer mode
- options (COMPRESSED, ELITE, DOUBLE, EMPHASIZED, ITALIC, LPI
- n, PROPORTIONAL, P1-P3 and RESET) send hardware-specific
- escape sequences to the printer. These are all the escape
- codes used by TDPRT; no other options send any special codes.
-
- TDPRT was written for Epson FX series printers, but can be
- configured for any printer. The FX option on the command
- line resets all escape sequences for Epson FX printers. Each
- sequence can be up to 25 bytes long. Use P1-P3 to enter
- additional setup strings for your own needs.
-
- The Configure option brings up a screen listing the setup
- strings. You select one for modification. TDPRT will
- display it in decimal-ASCII and in character, and let you
- type in a new one. Just press enter to keep the old one,
- type "null" in lower case to delete the string. (Yes, this
- precludes having a printer setup string of "null"; a chance
- I'll take.)
-
- Here's how to enter a new string. To enter a decimal ASCII
- code, type slash and three digits. For example, escape is
- /027. To enter a character, just type the character. For
- example, Proportional mode is escape "p1", or "/027p1". To
- enter a slash character, type two slashes "//".
-
- Here are the setup strings for Epson FX series printers.
- Letters must be entered in upper and lower case as shown.
-
- Compressed /015
- Double /027G
- Elite /027M
- Emphasized /027E
- Italic /0274
- Proportional /027p1
- Six LPI /0272
- Eight LPI /0270
- Reset /018/027H/027P/027F/0275/0272/027p0
-
- Here are the setup strings for NEC P3 and compatible printers
-
- Compressed /027?7
- Double /027G
- Elite /027?3
- Emphasized /027?1
- Italic null
- Proportional /027?5
- Six LPI /0272
- Eight LPI /0270
- NLQPICA /027?2
- NLQELITE /027?4
- NLQPROP /027?6
- Reset /018/027H/0272/027?0
-
- I didn't use the Epson Master Reset sequence to reset the
- Epson as this cancels any other things you might have sent to
- the printer, such as downloaded fonts, form lengths, etc.
-
- Remember, the strings you see on the Configure screen are the
- only escape sequences sent to the printer. If you've been
- wondering if TDPRT used special printer commands to control
- margins or line width or anything else, the answer is NO. You
- could certainly add any kind of printer commands you like to
- the setup strings.
-
- You can modify the names of the user-defined printer strings
- and use the new names on the command line. For example, if
- your printer has a Near Letter Quality mode you might rename
- P1 as "NLQ". Don't put any spaces in the name.
-
- Your new name replaces the old in the parsing routine; it
- must not duplicate any other option keywords, and you must
- enter enough letters on the command line to distinguish it
- from the other keywords. You can use 'NO' with your own
- options, for example 'NONLQ'.
-
-
- Tabs
-
- TDPRT expands tab characters before checking line length for
- WRAP or TRUNCATE. Tabs are multiples of TabWidth plus 1. For
- the default tab width of 8, this means 1, 9, 17 etc. Some
- programmers prefer tab width of 3 for source listings, giving
- 1, 4, 7, 10, etc. A tab width of 1 would simply convert tabs
- into spaces. The maximum TabWidth is 30.
-
-
- Form Feeds
-
- If TDPRT encounters a form-feed (Chr(12)) in the input file,
- it ends the current page and starts the next. Page numbering
- is correctly maintained.
-
- Some word processors and other applications send a form feed
- before printing, but not after. This makes them nicely
- compatible with themselves, but not necessarily you. Their
- idea is that the form feed guarantees they will start on a
- fresh page, regardless of what program might have printed a
- partial page already.
-
- My objection is that I almost always advance the paper and
- tear off the latest pages for proofing as soon as they are
- done. When a program sends another form feed before the next
- job, it wastes a whole sheet of paper.
-
- TDPRT does NOT send a form feed before printing. If you
- would like it to, just add "/012" to 6 LPI and 8 LPI, since
- one or the other is always sent. To make it optional, put it
- in one of the user setup strings.
-
- TDPRT doesn't send a formfeed at the end of the job. It does
- print enough blank lines to advance the paper to the next
- form. If you'd like an extra form feed after, add it to the
- RESET string.
-
-
- Usage Notes:
-
- I'm the first to admit that the options can be overwhelming.
- Many users will spend some time experimenting, settle on one
- combination of options, make them their personal default, and
- forget the rest. If you find several complex sets of options
- you need for different purposes, you might make batch files
- to invoke TDPRT with the ones you need. SET and CONFIGURE
- options will not work if you rename the COM file.
-
- I sometimes get the program configured with many options and
- want to print something "vanilla" without any of them. That
- is why "STANDARD" is there. It resets everything except the
- printer setup strings to the "factory" specs. Anything you
- code before STANDARD is ignored; anything after is used.
-
- The same kind of reset is available for printer setup strings
- with the FX option. Issue both of the following commands to
- return EVERYTHING to normal:
-
- TDPRT ( STANDARD SAVE
- TDPRT ( FX CONFIGURE
-
- Do NOT give a header in quotes on the command line when doing
- SAVE. I'm working on a fix that would let you do something
- like "/f Your Name /p". You can give UHEADER with SAVE to
- make the program always prompt you for a header.
-
-
- Printer Ready
-
- TDPRT checks to see if the printer is ready before sending
- output to it. If the printer is not available, you have the
- choice of getting it online and trying again, or halting the
- program.
-
- If the printer runs out of paper or goes offline after the
- program has started, you will still get the dreaded "Abort,
- Retry or Ignore" message from DOS. If you TOFILE to a disk
- file, TDPRT won't check the printer.
-
-
- Favorite setups:
-
- My favorite right now is "( ELITE MAR 10 WIDTH 96 NUM LPI 8".
- I use this with program listings. I need numbers for the
- CLIPPER debugger. The margin and elite type leave wide
- margins for binding or pencil notes. Eight lines per inch
- gets more stuff on fewer pages. Let me know if you come up
- with nice combinations.
-
-
- Suggested enhancements:
-
- These things will be added to TDPRT if possible and as my
- time allows:
- Allow /d and /t for date and time in headers.
- Allow /f and /p anywhere in the header.
-
-
-
- Distribution:
-
- This program, in source and object form, is protected by
- copyright law, and is NOT in the public domain. It is,
- however, "user-distributed". It may be distributed freely in
- any manner, with the following restrictions:
-
- 1 - Do not charge for distribution of this program, beyond
- the cost of reproduction & mailing.
- 2 - Distribute this documentation with the program.
- 3 - Leave the author's name & address in the document.
- 4 - Do not distribute modified versions.
-
- It is the author's desire that no other party make a profit
- from distribution of this program. I specifically deny
- permission to use this program to companies like PC-Sig or
- bulletin boards which charge for download privileges.
-
- If you want to promote user-distributed software and feel the
- program is useful enough to be worth $15.00, the contribution
- will certainly be appreciated. It will also get you on a
- mailing list for future versions and other utilities.
- Include a diskette and self-addressed mailer if you'd like
- the source code. Source code may not be distributed by you.
-
-
- Availability:
-
- Current versions of all Saxman Software Tools Disk Series
- programs are available from the Information Booth bulletin
- board in Wichita. The board is also a good way to contact
- the author.
-
- Information Booth 316-684-8744 300-1200-2400 8-n-1
-
- This board normally requires registration and a number of
- upload contributions before allowing downloads. For certain
- special products listed on the introductory screen these
- requirements are waived. You will be able to download most
- Saxman Software programs on the first call. See TDTOOLS.TXT
- for a list of Tools Disk programs.
-
-
- Author:
-
- Jim Standley
- Saxman Software
- 2350 Winstead Circle
- Wichita, Ks 67226
- 316-688-0235 18:00-22:00 CST
-
-
- Revision Log:
-
- 10/04/86 - First public version
- 10/11/86 - Tabs expansion added
- Standard option extended to reset all options.
- Save & Configure search path for the COM file.
- FX option added.
- Corrected bug that lost characters at end of file.
- 10/28/86 - Slash options allowed.
- Space after open paren not required.
- Title in single or double quotes.
- FROMLINE, TOLINE, FROMPAGE, TOPAGE added.
- TO option changed to TOFILE. Min abbrev the same.
- FormLength 255 line max added.
- Version 1.4, never released.
- 11/14/86 - Corrected formlength bug that made multiple files
- "creep" down the paper.
- Added DOS option.
- Enhanced display on errors.
- Version 1.5.
- 12/28/86 - Corrected bug when title was first option.
- Corrected new creep problem introduced in 1.5.
- Added user names for user print options.
- Version 1.6.
- 03/07/87 - Added printer check before starting print.
- Version 1.7.
- 05/24/87 - Minor cosmetic change to error handling.
- Version 1.8.
- 08/11/87 - Added NEC P3 option.
- Version 1.9.
- 09/27/87 - Added PICA option, plus NOxxxx for all print
- modes. Corrected some oversights in duplicate
- keywords. Now all documented options work!
- Version 2.0.
- 10/22/87 - Added TabWidth
- Version 2.1.
- 11/15/87 - Correct global or wildcard in another directory.
- Thanks to Doug McGrath for pointing out the bug.
- Change to BIOS interrupt for printing.
- Corrected bug with TabWidth > 8.
- Version 2.2.